package Eyjafjalla.action;

import Eyjafjalla.patch.CloudPatch;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.utility.NewQueueCardAction;
import com.megacrit.cardcrawl.actions.utility.UnlimboAction;
import com.megacrit.cardcrawl.actions.utility.WaitAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.core.Settings;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;

public class DiscardTopCloudAction extends AbstractGameAction {

    public DiscardTopCloudAction() {
        this.duration = Settings.ACTION_DUR_FAST;
        this.actionType = ActionType.DISCARD;
        this.source = AbstractDungeon.player;
    }

    public void update() {
        if (this.duration == Settings.ACTION_DUR_FAST) {
            if (CloudPatch.cloudGroup.isEmpty()) {
                this.isDone = true;
                return;
            }
            AbstractCard card = CloudPatch.cloudGroup.getBottomCard();
            CloudPatch.cloudGroup.moveToDiscardPile(card);
            CloudPatch.CloudField.inCloud.set(card,false);

            this.isDone = true;
        }

    }
}

